def countLines(name):
    with open(name) as f:
        return sum(1 for line in f)
        # return len(list(open(name)))


def countChars(name):
    with open(name) as f:
        return sum(len(line) for line in f)
        # return len(f.read())


def test(name):
    return countLines(name), countChars(name)


if __name__ == '__main__':
    print(test('p1.py'))
